package com.lichao.FinkDataProcess.compare;

import com.alibaba.fastjson.JSONObject;
import com.lichao.FinkDataProcess.rel.Node;


import java.lang.reflect.Field;

/**
 * @author: li chao
 * @Desc:
 * @create: 2024-11-15 21:12
 **/
public abstract class CompareNode implements Node {

    private String fieldName;
    private String operateType;
    private Object value;
    private Field field;

    public CompareNode(String fieldName, String operateType, Object value) {
        this.fieldName = fieldName;
        this.operateType = operateType;
        this.value = value;
    }

    public abstract boolean compare(JSONObject json)  throws Exception;

    public String getFieldName() {
        return fieldName;
    }

    public String getOperateType() {
        return operateType;
    }

    public Object getValue() {
        return value;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public void setOperateType(String operateType) {
        this.operateType = operateType;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public Field getField() {
        return field;
    }

    public void setField(Field field) {
        this.field = field;
    }
}
